/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import java.io.IOException;

/**
 *
 * @author Kvest
 */
public class StringUtils 
{
    public static byte[] strToBytes(String data)
    {
        try
        {
            return data.getBytes("utf-8");
        }
        catch(IOException ioex)
        {
            return data.getBytes();
        }
    }
    
    public static String bytesToStr(byte[] data)
    {
        try
        {
            return new String(data, "utf-8");
        }
        catch(Exception ioex)
        {
            return new String(data);
        }
    }
}
